Repository navigation
fix(ipc-runtime): terminate a wasm main worker that fails to start - #25763
Merged
Conversation
just-mitch
force-pushed
the
mitch/zkm-1784-a-bbjs-wasm-main-worker-that-fails-to-start-stays-alive
branch
from
November 4, 2026 20:40
dc3e36c to
82407d5
Compare
just-mitch
marked this pull request as ready for review
November 5, 2026 01:17
just-mitch
force-pushed
the
mitch/zkm-1784-a-bbjs-wasm-main-worker-that-fails-to-start-stays-alive
branch
from
November 5, 2026 16:53
82407d5 to
7047073
Compare
Collaborator
Flakey Tests🤖 says: This CI run detected 1 tests that failed, but were tolerated due to a .test_patterns.yml entry. |
just-mitch
added a commit
that referenced
this pull request
Nov 5, 2026
…mory maximum (#25760) Before this PR, an iPad and an iPhone with Request Desktop Website on got the desktop wasm memory maximum of 4 GiB, because they send a Mac user agent. On an iPad, the zk.money PXE failed with "RangeError: Out of memory". After this PR, these devices get the iOS maximum of 1 GiB (`2 ** 14` pages) when the page creates the backend. ## The thread that creates the backend resolves the memory maximum A worker has no `navigator.maxTouchPoints`, so the main worker cannot detect these devices. `WasmFfiBackend.create` resolves the maximum and sends it in the `init` message. A maximum that the caller sets still has priority. Evidence: the Pointer Events WebIDL declares `maxTouchPoints` on `Navigator` only. ## `isIos` in `@aztec-foundation/ipc-runtime/wasm` It matches `iPad` or `iPhone`, or a `Macintosh` user agent with `maxTouchPoints > 1`. It is not in the package root, which imports `node:net` and `node:child_process`. ## Other changes - The iOS and desktop values stay the same. - `WasmPlatform.maximumMemoryPages` documents the thread that reads it. ## Known issues - A backend that a Web Worker creates still gets the desktop maximum. The wallet sets the values explicitly in ZKM-1780. Ticket: ZKM-1779. Child PRs: #25761, #25763.
Before, the worker stayed alive after init-error: in Node.js it kept the process from exiting, and each retry leaked one more worker. ZKM-1784
just-mitch
force-pushed
the
mitch/zkm-1784-a-bbjs-wasm-main-worker-that-fails-to-start-stays-alive
branch
from
November 5, 2026 17:47
7047073 to
9726ecf
Compare
iakovenkos
approved these changes
Nov 6, 2026
just-mitch
deleted the
mitch/zkm-1784-a-bbjs-wasm-main-worker-that-fails-to-start-stays-alive
branch
November 7, 2026 18:50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before this PR, when the bb.js wasm main worker failed to start, the worker stayed alive. In Node.js, the process did not exit, and each retry of
Barretenberg.initSingletonleft one more worker.After this PR,
WasmFfiBackend.createterminates the worker, and then throws the start error.Ticket: ZKM-1784 (parent ZKM-1779). Parent PR: #25761.